package hxg.json;

/**
 * @author HeXiangGuang
 * @create 2021-10-27 16:46
 */
public class Demo {/*
    //不存在系统  否
    public ResponseData notreplace() {
        List<MpsDuplicateData> mpsDuplicateData = mpsDuplicateDataMapper.selectList(null); //查询中间表
        String json = JSON.toJSONString(mpsDuplicateData);
        Object parse = JSON.parse(json);
        String str = parse.toString();
        //这个list是导入的所有数据是吧
        List<MpsDuplicateData> list = JSON.parseArray(str, MpsDuplicateData.class);
        for (MpsDuplicateData selectmpsDuplicateData : list) {
            JSONObject jsonObject = JSON.parseObject(selectmpsDuplicateData.getData());
            MpsBusiness mpsBusiness = jsonObject.toJavaObject(MpsBusiness.class);
            //这里就算你那个判断,如果系统中有个数据selectmpsBusiness对象就有数据是吧，
            // 然后查询不到就证明系统里面没有这个数据然后把mpsBusiness对象添加到系统表不就可以了
            MpsBusiness selectmpsBusiness = mpsBusinessService.getOne(new QueryWrapper<MpsBusiness>()
                    .eq("id", mpsBusiness.getId()));
            //selectmpsBusiness对象等于null的时候代码这个数据系统里没则添加
            if(selectmpsBusiness == null){
                this.mpsBusinessService.save(mpsBusiness);
            }
        }
        return ResponseData.success();
    }*/

}
